#
# @lc app=leetcode.cn id=1816 lang=python3
#
# [1816] 截断句子
#

# @lc code=start
class Solution:
    def truncateSentence(self, s: str, k: int) -> str:
        s=s.split(" ")
        newstr=s[0]
        for i in range(1,k):
            newstr+=" "+s[i]
        return newstr
# @lc code=end

